package com.ssk.sh.web.controller;

import com.ssk.sh.model.User;
import com.ssk.sh.service.IUserService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author ssk
 * @since 2025-06-18
 */
@RestController
@RequestMapping("/user")
@Tag(name = "user", description = "user")
@AllArgsConstructor
public class UserController {

    private final IUserService userService;

    @RequestMapping("/save")
    public Mono<User> save() {
        User user = new User();
        user.setName("ssk");
        userService.save(user);

        user.setAge(12);
        userService.updateById(user);

        return Mono.just(user);
    }
}
